package com.example.room.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

// Order 实体类
@Entity(tableName = "orders")
public class Order {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "order_id")
    public long orderId;

    @ColumnInfo(name = "user_id")
    public long userId; // 外键，关联到 User 表的 user_id

    @ColumnInfo(name = "product_name")
    public String productName;

    // 其他订单信息字段


    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", userId=" + userId +
                ", productName='" + productName + '\'' +
                '}';
    }
}
